/*
 * @Author: xiaosihan 
 * @Date: 2022-07-15 14:48:27 
 * @Last Modified by: xiaosihan
 * @Last Modified time: 2022-07-15 15:12:13
 */

import globalStore from "@globalStore";
import { autorun, toJS } from "mobx";
import { useEffect, useRef } from "react";
import styles from "./Container.module.less";

export default function Container() {

    const divDom = useRef<HTMLDivElement>(null);

    useEffect(() => autorun(() => {
        const { height } = toJS(globalStore.windowSize);
        const scale = Math.min(1, height / 1080);
        if (divDom.current) {
            divDom.current.style.transform = `translate(0%, -50%) scale(${scale})`;
        }
    }), []);

    return (

        <div ref={divDom} className={styles.container} >
            左容器自适应demo
        </div>
    );

}